

/*
消息队列实现
基于FreeRTOS队列
*/
#include "FreeRTOS.h"
#include "queue.h"
#include "MessageDefine.h"

static QueueHandle_t mQueue;

__WEAK void MsgQueue_Init(void){	
	 mQueue = xQueueCreate( 8, sizeof( Message_T ) );
}

__WEAK void MsgQueue_Deinit(void){
	vQueueDelete(mQueue);
}

__WEAK int MsgQueue_Post(Message_T msg){
	BaseType_t ret;

	ret = xQueueSendToBack(mQueue, &msg, 0);
	if(ret){
		return 0;
	}
	return -1;
}

__WEAK int MsgQueue_Get(Message_T* msg, int ms){
	return -1;
}



